(define (id x) x)

(define (for a b thunk)
  ;; calls thunk on a, a+1, ... stopping before b
  (if (>= a b)
      #t
      (begin (thunk a) (for (+ a 1) b thunk))))
